package com.wing.productionPlan.model.entity;

import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.core.enums.IEnum;
import com.wing.mybatis.common.BaseEntity;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

/**
 * 质检记录详情表
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
@TableName("ord_quality_testing_record_detail")
public class QualityTestingRecordDetail extends BaseEntity<QualityTestingRecordDetail> implements Serializable {

    private static final long serialVersionUID = 1L;

    public enum QualityTestingResult implements IEnum<Integer> {

        /**
        * 合格
        */
        qualified(0,"合格"),
        /**
        * 不合格
        */
        unqualified(1,"不合格"),
        /**
        * 其他
        */
        other(2,"其他");

        private int code;
        private String desc;

        QualityTestingResult(int code,String desc){
            this.code=code;
            this.desc=desc;
        }

        @Override
        public Integer getValue(){
            return this.code;
        }

        public String getDesc(){
            return this.desc;
        }
    }

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * day
     */
    private Integer day;

    /**
     * no
     */
    private Integer no;

    /**
     * 企业编号
     */
    private String enterpriseCode;

    /**
     * 质检记录明细编码
     */
    private String code;

    /**
     * 样品编码
     */
    private String sampleCode;

    /**
     * 质检参数结果
     */
    private String parametersResult;

    /**
     * 质检评定结果
     */
    private QualityTestingResult qualityTestingResult;

    /**
    * 质检评定结果描述
    */
    @TableField(exist = false)
    private String qualityTestingResultDesc;

    public String getQualityTestingResultDesc() {
        return qualityTestingResult == null ? null : qualityTestingResult.getDesc();
    }

    /**
     * 质检记录id
     */
    private Long qualityTestingRecordId;

    /**
     * 质检任务单id
     */
    private Long qualityTestingTaskId;

    /**
     * 检验工站id
     */
    private Long inspectDeviceId;

    /**
     * 检验工站编号
     */
    private String inspectDeviceCode;

    /**
     * 工序id
     */
    private Long processId;

    /**
     * 工序名称
     */
    private String processName;

    /**
     * 状态
     */
    private String status;

    /**
     * 处理方式 0.报废 1.返修
     */
    private String dealWay;

    /**
     * 纸质单
     */
    private String paperSlipPic;

}
